
package com.amigo.online.provider.manager.service.impl;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.amigo.online.provider.manager.mapper.AdvNearbySourceTblMapper;
import com.amigo.online.provider.manager.model.entity.AdvNearbySourceTbl;
import com.amigo.online.provider.manager.service.AdvNearbySourceTblService;

/**
 * <code>AdvNearbySourceTblServiceImpl.java</code>
 * <p>
 *
 * </p>
 * <p>
 *
 * @author LuChen
 * @version 1.0
 * @company Amigo
 * @time 2018年11月27日 上午9:42:56
 * @lastUpdate 无
 * </p>
 */
@Service
@Transactional(rollbackFor = Exception.class)
public class AdvNearbySourceTblServiceImpl implements AdvNearbySourceTblService {


    @Autowired
    private AdvNearbySourceTblMapper advNearbySourceTblMapper;


    @Override
    public AdvNearbySourceTbl addAdvNearbySourceApply(AdvNearbySourceTbl advNearbySourceTbl) {
        advNearbySourceTbl.setStatus(0);
        if (advNearbySourceTblMapper.insert(advNearbySourceTbl) > 0) {
            advNearbySourceTbl = advNearbySourceTblMapper.selectOne(advNearbySourceTbl);
            return advNearbySourceTbl;
        }
        return null;
    }


    @Override
    public boolean updateNearbyAdvSource(AdvNearbySourceTbl advNearbySourceTbl) {
        if (advNearbySourceTblMapper.updateById(advNearbySourceTbl) > 0) {
            return true;
        }
        return false;
    }


}

